package ch.ti.bfh.app.loodel.web.model;

import ch.ti.bfh.app.loodel.service.timeslotschedule.TimeSlotScheduleSearchCriteria;
import ch.ti.bfh.app.loodel.service.vote.LearningEventVoteData;
import org.joda.time.LocalDate;
import org.primefaces.model.ScheduleModel;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("view")
public class MemberTimeSlotScheduleModel {

    private TimeSlotScheduleSearchCriteria timeSlotScheduleSearchCriteria = new TimeSlotScheduleSearchCriteria();

    private ScheduleModel scheduleModel;

    private LearningEventVoteData learningEventVoteData;

    public void reset() {
        this.timeSlotScheduleSearchCriteria = new TimeSlotScheduleSearchCriteria();
        this.timeSlotScheduleSearchCriteria.setShowOnlyAcceptedTimeSlots(false);
        this.timeSlotScheduleSearchCriteria.setShowOnlyClosedLearningEventTimeSlots(false);
        this.timeSlotScheduleSearchCriteria.setShowOnlyMyVotedTimeSlots(false);
        this.timeSlotScheduleSearchCriteria.setStartDateRange(new LocalDate().dayOfMonth().withMinimumValue());
        this.timeSlotScheduleSearchCriteria.setEndDateRange(new LocalDate().dayOfMonth().withMaximumValue());
    }

    public TimeSlotScheduleSearchCriteria getTimeSlotScheduleSearchCriteria() {
        return timeSlotScheduleSearchCriteria;
    }

    public void setTimeSlotScheduleSearchCriteria(TimeSlotScheduleSearchCriteria timeSlotScheduleSearchCriteria) {
        this.timeSlotScheduleSearchCriteria = timeSlotScheduleSearchCriteria;
    }


    public ScheduleModel getScheduleModel() {
        return scheduleModel;
    }

    public void setScheduleModel(ScheduleModel scheduleModel) {
        this.scheduleModel = scheduleModel;
    }

    public void setLearningEventVoteData(LearningEventVoteData learningEventVoteData) {
        this.learningEventVoteData = learningEventVoteData;
    }

    public LearningEventVoteData getLearningEventVoteData() {
        return learningEventVoteData;
    }
}
